<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="org.test.once.model.Module"%>
<%
	List<Module> modules = (List<Module>)request.getAttribute("modules");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>模块管理</title>
<link href="style/oa.css" rel="stylesheet" type="text/css">
<script language="javascript" src="script/public.js">
</script>

</head>
<body>
<BODY bgColor=#dee7ff leftMargin=0 background="" topMargin=0 marginheight="0" marginwidth="0">
<center>
      <TABLE width="100%" border=0 align=center cellPadding=0 cellSpacing=0 borderColor=#ffffff style="FONT-SIZE: 10pt">
        <TBODY>
          <TR>
            <TD width="82%" height=14 align=right vAlign=center noWrap>
            </TD>
            <TD width="18%" align=right vAlign=center noWrap>　</TD>
          </TR>
          <TR>
            <TD height=14 align=right vAlign=center noWrap>
            	<!-- 在这里插入查询表单 -->
            </TD>
            <TD height=14 align="left" vAlign=center noWrap>
            </TD>
          </TR>
          <TR>
            <TD height=28 colspan="2" align=right vAlign=center noWrap background=images/list_middle.jpg>&nbsp;&nbsp;
            	<a href="#" onclick="openWin('module/add_input.jsp?','chgpsw', 740, 300);">添加模块</a>
            </TD>
          </TR>
        </TBODY>
      </TABLE>
      <table width="100%" border="0" cellPadding="0" cellSpacing="1" bgcolor="#6386d6">
          <!-- 列表标题栏 -->
	      <tr bgcolor="#EFF3F7" class="TableBody1">
		      <td width="10%" height="37" align="center"><b>序号</b></td>
		      <td width="20%" height="37" align="center"><B>名字</B></td>
              <td width="20%" height="37" align="center"><b>父节点</b></td>
              <td width="20%" height="37" align="center"><b>URl地址</b></td>
              <td width="45%" height="37" align="center"><b>操作</b></td>
          </tr>
          <!-- 列表数据栏 -->
          
          <%if(!modules.isEmpty()) {%>
          <%for(Module module : modules)  {%>
	      <tr bgcolor="#EFF3F7" class="TableBody1" onmouseover="this.bgColor = '#DEE7FF';" onmouseout="this.bgColor='#EFF3F7';">
		      <td align="center" vAlign="center"><%=module.getId() %></td>
	          <td align="center" vAlign="center"><%=module.getName() %></a></td>
	          <td align="center" vAlign="center"><%=module.getPid() %></td>
	          <td align="center" vAlign="center"></td>
	          <td align="center" vAlign="center">
	          <a href="#" onclick="del('ModuleServlet?command=delModule&id=<%=module.getId()%>');">删除模块</a>
	          <a href="#" onclick="openWin('ModuleServlet?command=findByid&id=<%=module.getId() %>','chgpsw', 740, 400);">修改模块</a>
	          </td>
        	</tr>
        <%} %>
		<%} %>
        <!-- 在列表数据为空的时候，要显示的提示信息 -->
	    <%if(modules.isEmpty()) {%>
	    <tr>
	    	<td colspan="7" align="center" bgcolor="#EFF3F7" class="TableBody1" onmouseover="this.bgColor = '#DEE7FF';" onmouseout="this.bgColor='#EFF3F7';">
	    	没有找到相应的记录
	    	</td>
	    </tr>
	    <%
	    }
	     %>
      </table>
</center>
</body>
</html>